package com.hc.testaudio.deletea.test1.ui

import android.Manifest
import android.content.Intent
import android.os.Bundle
import com.hc.testaudio.R
import com.hc.testaudio.deletea.ui.AudioChartActivity
import com.hc.testaudio.deletea.ui.BaseActivity
import com.hc.testaudio.ui.TestAudioRecordActivity
import com.yc.yclibx.permissions.YcUtilPermission
import kotlinx.android.synthetic.main.main_activity.*

/**
 *
 */
class MainActivity : BaseActivity() {
    override fun getLayoutId(): Int {
        return R.layout.main_activity
    }

    override fun initView(savedInstanceState: Bundle?) {
        YcUtilPermission.newInstance(activity)
            .addPermissions(YcUtilPermission.PERMISSION_STORAGE)
            .addPermissions(Manifest.permission.RECORD_AUDIO)
            .addPermissions(Manifest.permission.CAMERA)
            .start()
        main1Btn.setOnClickListener {
            startActivity(Intent(this, BarChartActivity::class.java))
        }
        main2Btn.setOnClickListener {
            TestAudioRecordActivity.startActivity(this)
        }
        main3Btn.setOnClickListener {
            startActivity(Intent(this, MediaExtractorActivity::class.java))
        }
        main4Btn.setOnClickListener {
            startActivity(Intent(this, AudioChartActivity::class.java))
        }

    }
}
